package lanQiaoBei.testQuestions.编程题;

import java.util.Scanner;

public class _02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long k = scanner.nextLong();

        long l=5;
        long r=Long.MAX_VALUE-1;
        while (l<=r){
            long mid=l+((r-l)>>1);
            long cal=calcZeroNum(mid);
            if(cal>k){
                r=mid-1;
            }else if(cal<k){
                l=mid+1;
            }else {
                while (mid%5!=0){
                    mid--;
                }
                System.out.println(mid);
                return;
            }
        }
        System.out.println(-1);
    }
    public static long calcZeroNum(long n){
           n/=5;
           long res=0;
           while (n>0){
               res+=n;
               n/=5;
           }
           return res;
    }
}
